<template>
    <div>
        <h1>大头儿子</h1>
        <button @click="say">大头儿子说</button>
    </div>
</template>

<script>
// $emit自定义事件（子传父）


export default {
    name: 'App',
    props: [''],
    mounted() {
        console.log(this);
        this.$emit("yangyang", "答对了");
    },
    data() {
        return {

        };
    },
    components: {

    },
    methods: {
        say() {
            // 触发分发事件
            this.$emit("addItem", { name: "lili", age: 10 });
        },
    },
}
</script>

<style lang="scss" scoped>

</style>